<template>
  <div id="app">
   <el-container>
  <el-header>
    <el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect">
  <el-menu-item index="/index">处理中心</el-menu-item>
  <el-menu-item index="/users">用户中心</el-menu-item>
  <el-menu-item index="/msg" >消息中心</el-menu-item>
  <el-menu-item index="4"><a href="https://www.ele.me" target="_blank">订单管理</a></el-menu-item>
</el-menu>

  </el-header>
  <el-main>
    <router-view></router-view>
  </el-main>
</el-container>
  </div>
</template>

<script>
export default {
  name: "App",
  data() {
    return {
      //默认激活
      activeIndex: this.$route.path,
    };
  },
  methods: {
    handleSelect(key, keyPath) {
      console.log(key, keyPath);
      // 切换路由
      
      this.$router.push(key);
    
    }
  }
};
</script>

<style></style>
